/**
 * Project: shuyin-sync
 * 
 * File Created at Mar 22, 2012
 * $Id$
 * 
 * Copyright 2008 6677bank.com Croporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * 6677bank Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with 6677bank.com.
 */
package com.bank6677.sync.csm.dao.impl;

import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import com.bank6677.sync.csm.dao.ClassificationDao;
import com.bank6677.sync.csm.domain.Classification;
import com.ibatis.sqlmap.client.SqlMapClient;

/**
 * TODO Comment of ClassificationDaoImpl
 * 
 * @author liyue
 * @version ClassificationDaoImpl.java Mar 22, 2012 2:08:29 PM
 */

@Repository
public class ClassificationDaoImpl implements ClassificationDao {

    @Autowired
    @Qualifier("newpayxSqlMapClient")
    private SqlMapClient newpayxClient;

    @Autowired
    @Qualifier("cmbankSqlMapClient")
    private SqlMapClient cmbankSqlMapClient;

    @Override
    public void createNewClassification(Classification classification) throws SQLException {
        
    }

    @Override
    public void batchCreateNewClassification(List<Classification> classifications)
            throws SQLException {
        cmbankSqlMapClient.startBatch();
        for (Classification classification : classifications) {
            cmbankSqlMapClient.insert("reject_type.insertNewRejectType", classification);
        }
        cmbankSqlMapClient.executeBatch();
    }

    @Override
    public List<Classification> findAllRejectTypes2new() throws SQLException {
        return newpayxClient.queryForList("reject_type.findAllOldRejectType2new");
    }

}
